import request from '@/config/axios'

// 软件分类 VO
export interface SoftCategoryVO {
  id: number // 分类ID
  categoryName: string // 分类名称
  sort: number // 显示顺序
  status: number // 状态（0正常 1停用）
}

// 软件分类 API
export const SoftCategoryApi = {
  // 查询软件分类分页
  getSoftCategoryPage: async (params: any) => {
    return await request.get({ url: `/client/soft-category/page`, params })
  },

  // 查询软件分类详情
  getSoftCategory: async (id: number) => {
    return await request.get({ url: `/client/soft-category/get?id=` + id })
  },

  // 新增软件分类
  createSoftCategory: async (data: SoftCategoryVO) => {
    return await request.post({ url: `/client/soft-category/create`, data })
  },

  // 修改软件分类
  updateSoftCategory: async (data: SoftCategoryVO) => {
    return await request.put({ url: `/client/soft-category/update`, data })
  },

  // 删除软件分类
  deleteSoftCategory: async (id: number) => {
    return await request.delete({ url: `/client/soft-category/delete?id=` + id })
  },

  // 导出软件分类 Excel
  exportSoftCategory: async (params) => {
    return await request.download({ url: `/client/soft-category/export-excel`, params })
  }
}